<!DOCTYPE HTML>
<!--此处是引用thymeleaf的模板的语法-->
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title th:text="${titleName}"></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="/css/index.css">
    <script src="/js/jquery.js"></script>
    <script src="/js/bootstrap.min.js" type="application/javascript"></script>

</head>
<body>
<!--导入导航栏-->
<div th:insert="~{navigation::nav}"></div>
<div class="container-fluid main">
    <div class="row">
        <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
            <h2><span th:text="${titleName}"></span></h2>
            <hr>

            <div class="media" th:each="question:${pageParamDtos.getQuestionDtos()}">
                <div class="media-left">
                    <a href="#">
                        <img class="media-object img-circle"
                             th:src="${question.getUser().getAvatarUrl()}">
                    </a>
                </div>
                <div class="media-body">
                    <h3 class="media-heading" th:text="${question.getTitle()}"></h3>
                    <span class="text-desc"> <span th:text="${question.getCommentCount()}"></span> 个回复 · <span th:text="${question.getViewCount()}"></span>次浏览 · <span th:text="${#dates.format(question.getGmtCreate(), 'yyyy-MM-dd')}"></span></span>
                    <hr>
                </div>
            </div>
            <!--分页的样式列表展示-->
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    <li th:if="${pageParamDtos.showFirstPage}">
                        <a th:href="@{'/profile/'+${section}(pageNow=${1})}" aria-label="Previous">
                            <span aria-hidden="true">&lt;&lt;</span>
                        </a>
                    </li>
                    <li th:if="${pageParamDtos.showPrevison}">
                        <a th:href="@{'/profile/'+${section}(pageNow=${pageParamDtos.getCurrentPage()-1})}" aria-label="Previous">
                            <span aria-hidden="true">&lt;</span>
                        </a>
                    </li>
                    <!-- 此处就是显示我们分页的个数，使用循环的方式显示出来  -->
                    <li th:each="page:${pageParamDtos.getPages()}" th:class="${pageParamDtos.getCurrentPage()==page}?'active':''"><a th:href="@{'/profile/'+${section}(pageNow=${page})}" th:text="${page}"></a></li>

                    <li th:if="${pageParamDtos.showNextPage}">
                        <a th:href="@{'/profile/'+${section}(pageNow=${pageParamDtos.getCurrentPage()+1})}" aria-label="Previous">
                            <span aria-hidden="true">&gt;</span>
                        </a>
                    </li>
                    <li th:if="${pageParamDtos.showEndPage}">
                        <a th:href="@{'/profile/'+${section}(pageNow=${pageParamDtos.getTotlePages()})}" aria-label="Next">
                            <span aria-hidden="true">&gt;&gt;</span>
                        </a>
                    </li>
                </ul>
            </nav>


        </div>

        <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
            <div class="list-group">
                <a href="/profile/question" th:class="${section=='question'}?'active list-group-item':'list-group-item'">我的问题</a>
                <a href="/profile/replies" th:class="${section=='replies'}?'active list-group-item':'list-group-item'">最新回复
<!--添加回复的条数记录样式-->
                    <span class="badge">14</span>

                </a>

            </div>
        </div>
    </div>


</div>

</body>
</html>